// pages/student/mine/history/history.js
var app = getApp();
import {student_active} from "../../../../asserts/js/common/barList";
import {post} from "../../../../asserts/js/request";
Page({

  /**
   * 页面的初始数据
   */
  data: {
    barList: student_active(2),
    top: (app.globalData.bottom + 20 ) + 'px',
    list: [
      // {
      //   url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage.biaobaiju.com%2Fuploads%2F20180801%2F23%2F1533136383-HJscmFeIOx.jpg&refer=http%3A%2F%2Fimage.biaobaiju.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1618465210&t=34a70a1a8cd6a62ac7a4b0a5c831248a",
      //   title1: "初级伦巴前进walk训练",
      //   title2: "world of dance 比赛舞曲快速入门",
      //   time: "03:56",
      //   list: ["预习","组合","伦巴"],
      //   code: 1
      // },
      // {
      //   url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage.biaobaiju.com%2Fuploads%2F20180801%2F23%2F1533136383-HJscmFeIOx.jpg&refer=http%3A%2F%2Fimage.biaobaiju.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1618465210&t=34a70a1a8cd6a62ac7a4b0a5c831248a",
      //   title1: "终极伦巴前进walk训练",
      //   title2: "world of dance 比赛",
      //   time: "04:56",
      //   list: ["预习","悄悄","伦巴"],
      //   code: 2
      // },
      // {
      //   url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage.biaobaiju.com%2Fuploads%2F20180801%2F23%2F1533136383-HJscmFeIOx.jpg&refer=http%3A%2F%2Fimage.biaobaiju.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1618465210&t=34a70a1a8cd6a62ac7a4b0a5c831248a",
      //   title1: "终极伦巴前进walk训练",
      //   title2: "world of dance 比赛",
      //   time: "04:56",
      //   list: ["预习","悄悄","伦巴"],
      //   code: 3
      // },
      // {
      //   url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage.biaobaiju.com%2Fuploads%2F20180801%2F23%2F1533136383-HJscmFeIOx.jpg&refer=http%3A%2F%2Fimage.biaobaiju.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1618465210&t=34a70a1a8cd6a62ac7a4b0a5c831248a",
      //   title1: "终极伦巴前进walk训练",
      //   title2: "world of dance 比赛",
      //   time: "04:56",
      //   list: ["预习","悄悄","伦巴"],
      //   code: 4
      // },
      // {
      //   url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage.biaobaiju.com%2Fuploads%2F20180801%2F23%2F1533136383-HJscmFeIOx.jpg&refer=http%3A%2F%2Fimage.biaobaiju.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1618465210&t=34a70a1a8cd6a62ac7a4b0a5c831248a",
      //   title1: "终极伦巴前进walk训练",
      //   title2: "world of dance 比赛",
      //   time: "04:56",
      //   list: ["预习","悄悄","伦巴"],
      //   code: 5
      // },
      // {
      //   url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage.biaobaiju.com%2Fuploads%2F20180801%2F23%2F1533136383-HJscmFeIOx.jpg&refer=http%3A%2F%2Fimage.biaobaiju.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1618465210&t=34a70a1a8cd6a62ac7a4b0a5c831248a",
      //   title1: "终极伦巴前进walk训练",
      //   title2: "world of dance 比赛",
      //   time: "04:56",
      //   list: ["预习","悄悄","伦巴"],
      //   code: 6
      // },
      // {
      //   url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage.biaobaiju.com%2Fuploads%2F20180801%2F23%2F1533136383-HJscmFeIOx.jpg&refer=http%3A%2F%2Fimage.biaobaiju.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1618465210&t=34a70a1a8cd6a62ac7a4b0a5c831248a",
      //   title1: "终极伦巴前进walk训练",
      //   title2: "world of dance 比赛",
      //   time: "04:56",
      //   list: ["预习","悄悄","伦巴"],
      //   code: 7
      // },
      // {
      //   url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage.biaobaiju.com%2Fuploads%2F20180801%2F23%2F1533136383-HJscmFeIOx.jpg&refer=http%3A%2F%2Fimage.biaobaiju.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1618465210&t=34a70a1a8cd6a62ac7a4b0a5c831248a",
      //   title1: "终极伦巴前进walk训练",
      //   title2: "world of dance 比赛",
      //   time: "04:56",
      //   list: ["预习","悄悄","伦巴"],
      //   code: 8
      // }
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getData();
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  back: function() {
    wx.navigateBack({
      delta: 0,
    })
  },
  getData: function() {
    var this_ = this;
    post("stu-queryHistory",{
      studentId: app.globalData.studentInfo.studentId
    }).then(data => {
      var ori = data.browseHistory.map(item => {
        var arr = new Array();
        arr.push(item.courseNature);
        arr.push(item.courseKind);
        arr.push(item.danceKind);
        item.list = arr;
        return item;
      })
      this_.setData({
        list: ori
      })
    }).then(err => {
      console.log(err);
    })
  }
})